public class 子类变量与父类变量 {
    public static void main(String[] args) {
        ter t = new ter();
        t.showName();
        t.showMethod();
    }
}
class Person{
    String name = "父类变量";
    public void print1(){
        System.out.println(name);
    }
}
class ter extends Person{
    String name = "子类变量";
    public void showName(){
        String name ="局部名称";
        System.out.println(name);
        System.out.println(this.name);
        System.out.println(super.name);
    }
    @Override
    public void print1(){
        System.out.println("子类重写的print1");
    }
    public void showMethod(){
        print1();
        super.print1();
    }
}
